<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="author" content="Lsc">
    <script src="../jq/jquery-3.1.1.js"></script>
    <title>订单</title>
    <style>
    *{
        margin: 0;
        padding: 0;
    }

    section{
        width: 100px;
        margin: 15px auto;
        float: left;
    }
    div{
          /*display: inline-block;*/
          width: 100px;
          height: 30px;
          border: 1px solid gray;
          text-align: center;
          line-height: 30px;
          cursor: pointer;
    }
    
      ul{
          list-style: none;
          /*display: inline-block;*/
          display: none;
      }
      ul li{
          width: 100px;
          height: 30px;
          border: 1px solid gray;
          text-align: center;
          line-height: 30px;
          cursor: pointer;
          /*display: none;*/
      }
      ul li:hover{
          background-color: lightgray;
      }
      span{
          display: block;
          text-align: center;
          width: 200px;
          position: absolute;
          top: 155px;
          left: 10px;
      }
     

    </style>
</head>
<body>
    <section class="first">
    <div >销售订单</div>
    <ul>
        <li>订单1</li>
        <li>订单2</li>
        <li>订单3</li>
    </ul>
     </section>

     <section class="second">
    <div>消费订单</div>
    <ul>
        
        <li>消费1</li>
        <li>消费2</li>
        <li>消费3</li>
    </ul> 
    </section>
    <p style="clear: both"></p>
    
    <span></span>
</body>
</html>

<script>
// console.log($('.first'));
   
    $('.first div').mousemove(function(){ 
       $('.first>ul').css('display','block');
        
        $('.first>ul>li').click(function(){
          $('span').html($(this).html());
          $('ul').css('display','none');
        });

       $('.second>ul').css('display','none');
     });


     $('.second div').mousemove(function(){ 
       $('.second>ul').css('display','block');
       
        $('.second>ul>li').click(function(){
          $('span').html($(this).html());
          $('ul').css('display','none');
        });

     $('.first>ul').css('display','none');
     });
    
    
</script>

